<html>
<head><meta charset="utf-8"><title>Rust in 2021: Discoverability · general · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/index.html">general</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Rust.20in.202021.3A.20Discoverability.html">Rust in 2021: Discoverability</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="209253305"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Rust%20in%202021%3A%20Discoverability/near/209253305" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Rust.20in.202021.3A.20Discoverability.html#209253305">(Sep 07 2020 at 03:05)</a>:</h4>
<p>I wrote a 2021 blog post: <a href="https://jyn514.github.io/2020/09/05/Rust-in-2021.html">https://jyn514.github.io/2020/09/05/Rust-in-2021.html</a></p>



<a name="209253361"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Rust%20in%202021%3A%20Discoverability/near/209253361" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Rust.20in.202021.3A.20Discoverability.html#209253361">(Sep 07 2020 at 03:06)</a>:</h4>
<p>cross posted to reddit as well: <a href="https://www.reddit.com/r/rust/comments/inxwka/rust_in_2021_discoverability/">https://www.reddit.com/r/rust/comments/inxwka/rust_in_2021_discoverability/</a></p>



<a name="209253698"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Rust%20in%202021%3A%20Discoverability/near/209253698" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Rust.20in.202021.3A.20Discoverability.html#209253698">(Sep 07 2020 at 03:17)</a>:</h4>
<p>the bit about 'discoverability in the community' appears to have hit a nerve which is not what I expected <span aria-label="laughing" class="emoji emoji-1f606" role="img" title="laughing">:laughing:</span></p>



<a name="209255144"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Rust%20in%202021%3A%20Discoverability/near/209255144" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scottmcm <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Rust.20in.202021.3A.20Discoverability.html#209255144">(Sep 07 2020 at 04:01)</a>:</h4>
<p>To your points about library errors: it would be really cool to find some categories of clippy lints (or similar kinds of trouble that people hit) that we could move to language attributes somehow to let libraries report such things too without needing to make a whole lint.</p>
<p>A simple case would be for things like <a href="https://rust-lang.github.io/rust-clippy/master/index.html#iterator_step_by_zero">https://rust-lang.github.io/rust-clippy/master/index.html#iterator_step_by_zero</a> -- there could be an attribute where you set constants that are disallowed as arguments, say.</p>
<p>I think the <code>impl !Ord for MyThingThatIsIntentionallyOnlyPartial</code> as a way to give docs could go under this heading too...</p>



<a name="209255303"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Rust%20in%202021%3A%20Discoverability/near/209255303" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Rust.20in.202021.3A.20Discoverability.html#209255303">(Sep 07 2020 at 04:05)</a>:</h4>
<p>Hmm, that idea sounds interesting but not very flexible. It wouldn't have helped with either of the two error I gave as examples in the post, for instance</p>



<a name="209255310"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Rust%20in%202021%3A%20Discoverability/near/209255310" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Rust.20in.202021.3A.20Discoverability.html#209255310">(Sep 07 2020 at 04:05)</a>:</h4>
<p>Both of those were properties of <em>types</em>, not of values</p>



<a name="209255425"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Rust%20in%202021%3A%20Discoverability/near/209255425" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Rust.20in.202021.3A.20Discoverability.html#209255425">(Sep 07 2020 at 04:08)</a>:</h4>
<p>It would be nice to have 'clippy lints for libraries' though</p>



<a name="209255438"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Rust%20in%202021%3A%20Discoverability/near/209255438" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Rust.20in.202021.3A.20Discoverability.html#209255438">(Sep 07 2020 at 04:09)</a>:</h4>
<p>In particular I want to make these available <em>outside</em> the standard library, because other libraries don't have access to rustc internals and clippy can't write lints for them</p>



<a name="209255970"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Rust%20in%202021%3A%20Discoverability/near/209255970" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scottmcm <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Rust.20in.202021.3A.20Discoverability.html#209255970">(Sep 07 2020 at 04:22)</a>:</h4>
<p>Yeah, that's just the simplest explanation of the idea.  Someone would need to do the legwork to find things that are simple enough to express non-horribly in macros, but also complicated enough to be worth doing.</p>
<p>I wonder if the second example could just be something like <code>macro_rules arg_enum { {$x:tt*} =&gt; { compile_error!("use a derive instead: `#[clap::arg_enum]`") } };</code>...</p>



<a name="209255975"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Rust%20in%202021%3A%20Discoverability/near/209255975" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Rust.20in.202021.3A.20Discoverability.html#209255975">(Sep 07 2020 at 04:22)</a>:</h4>
<p>wouldn't that be a duplicate definition, because both are in the same namespace?</p>



<a name="209255977"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Rust%20in%202021%3A%20Discoverability/near/209255977" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Rust.20in.202021.3A.20Discoverability.html#209255977">(Sep 07 2020 at 04:22)</a>:</h4>
<p>not sure how derive macros work though</p>



<a name="209256067"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Rust%20in%202021%3A%20Discoverability/near/209256067" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scottmcm <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Rust.20in.202021.3A.20Discoverability.html#209256067">(Sep 07 2020 at 04:24)</a>:</h4>
<p>Oh, wow, by brain didn't even notice that the new one has the same name <span aria-label="face palm" class="emoji emoji-1f926" role="img" title="face palm">:face_palm:</span>  In that case I'm surprised the compiler isn't giving an error like "that's a derive macro, so you can't use it here" which would get 80% of the way there...</p>



<a name="209256119"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Rust%20in%202021%3A%20Discoverability/near/209256119" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Rust.20in.202021.3A.20Discoverability.html#209256119">(Sep 07 2020 at 04:26)</a>:</h4>
<p>yeah in general the error messages around macros could be improved</p>



<a name="209256121"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Rust%20in%202021%3A%20Discoverability/near/209256121" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Rust.20in.202021.3A.20Discoverability.html#209256121">(Sep 07 2020 at 04:26)</a>:</h4>
<p>that wouldn't need language changes either</p>



<a name="209256188"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Rust%20in%202021%3A%20Discoverability/near/209256188" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Rust.20in.202021.3A.20Discoverability.html#209256188">(Sep 07 2020 at 04:28)</a>:</h4>
<p>yup, just 'not in scope': <a href="https://play.rust-lang.org/?version=nightly&amp;mode=debug&amp;edition=2018&amp;gist=81691f8ee3b6f001133682563604ced5">https://play.rust-lang.org/?version=nightly&amp;mode=debug&amp;edition=2018&amp;gist=81691f8ee3b6f001133682563604ced5</a></p>



<a name="209256267"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Rust%20in%202021%3A%20Discoverability/near/209256267" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Rust.20in.202021.3A.20Discoverability.html#209256267">(Sep 07 2020 at 04:30)</a>:</h4>
<p>let me open an issue for that</p>



<a name="209256435"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Rust%20in%202021%3A%20Discoverability/near/209256435" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Rust.20in.202021.3A.20Discoverability.html#209256435">(Sep 07 2020 at 04:35)</a>:</h4>
<p><a href="https://github.com/rust-lang/rust/issues/76429">https://github.com/rust-lang/rust/issues/76429</a></p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>